<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
  <head>
    <title> Stepdown - Cucumber feature analysis</title>
    <link type='text/css' rel='stylesheet' href='stepdown.css'></link>
    <link type='text/css' rel='stylesheet' href='bootstrap.min.css'></link>
    <script src='jquery-1.6.1.min.js'></script>
    <script src='jquery.flot.min.js'></script>
    <script src='js-class.js'></script>
    <script src='bluff-min.js'></script>
    <script src='excanvas.js'></script>
    <script src='step_down.js'></script>
  </head>
  <body>
    <div class='container'>
      <div id='header'>
        <h1> Cucumber analysis</h1>
      </div>
      <div class='navbar'>
        <div class='navbar-inner'>
        <ul class='nav'>
          <li class="divider-vertical"></li>
          <li>
          <a href='#overview'> Overview</a>
          </li>
          <li class="divider-vertical"></li>
          <li>
            <a href='#trend'> Trend</a>
          </li>
          <li class="divider-vertical"></li>
          <li>
            <a href='#usage'> Step usage</a>
          </li>
          <li class="divider-vertical"></li>
          <li>
            <a href='#unused'> Unused steps</a>
          </li>
          <li class="divider-vertical"></li>
          <li>
            <a href='#empty'> Empty scenarios</a>
          </li>
          <li class="divider-vertical"></li>
          <li>
            <a href='#grouping'> Step grouping</a>
          </li>
          <li class="divider-vertical"></li>
        </ul>
      </div>
      </div>
      <div id='content'>
        <h2>
          <a name='overview'> Overview</a>
        </h2>
        <table class='table table-condensed table-bordered' style='width: 400px'>
          <tbody>
            <tr>
              <th> Stat</th>
              <th> Result</th>
            </tr>
            <tr>
              <td> Total number of scenarios</td>
              <td><%= total_scenarios %></td>
            </tr>
            <tr>
              <td> Total number of steps</td>
              <td><%= total_steps %></td>
            </tr>
            <tr>
              <td> Unused steps</td>
              <td><%= unused_step_count %></td>
            </tr>
            <tr>
              <td> Steps per scenario</td>
              <td><%= steps_per_scenario %></td>
            </tr>
            <tr>
              <td> Unique steps per scenario</td>
              <td><%= unique_steps %></td>
            </tr>
          </tbody>
          </table>
          <h2>
          <a name='trend'> Trend</a>
        </h2>
        <div id='graph' style="width:890px;height:400px">
        </div>
        <h2>
          <a name='usage'> Step usages</a>
        </h2>
        <div>
          Filter
          <br />
          Usage
          <select id='use_filter'>
            <option> All
            <option value='20'> >20</option>
            <option value='<50'> >50</option>
            <option value='<75'> >75</option>
            <option value='<100'> >100</option>
            <option value='<200'> >200</option>
            <option value='<300'> >300</option>
          </select>
          Scenarios
          Usage
          <select id='scenario_filter'>
            <option> All
            <option value='<10'> >10</option>
            <option value='<20'> >20</option>
            <option value='<50'> >50</option>
            <option value='<75'> >75</option>
            <option value='<100'> >100</option>
            <option value='<200'> >200</option>
            <option value='<300'> >300</option>
          </select>
        </div>
        <table id='usages' class='table table-condensed table-bordered'>
          <tbody>
            <tr>
              <th> Step</th>
              <th> Total usage</th>
              <th> Scenarios</th>
              <th> Use per scenario</th>
            </tr>

            <% usages.each do |use| %>
              <tr>
                <td><%= use.step.to_s %></td>
                <td><%= use.total_usage %></td>
                <td><%= use.number_scenarios %></td>
                <td><%= use.use_scenario %></td>
              </tr>
            <% end %>
          </tbody>
        </table>
        <p class="more"><a href="#">Show more</a></p>

        <h2>
          <a name='unused'> Unused steps</a>
        </h2>
        <table id='unused' class='table table-condensed table-bordered'>
          <tbody>
            <th> Step</th>

              <% unused.each do |use| %>
                <tr>
                  <td><%= use.step.to_s %></td>
                </tr>
              <% end %>
          </tbody>
        </table>
        <p class="more"><a href="#">Show more</a></p>

        <h2>
          <a name='empty'> Empty scenarios</a>
        </h2>
        <table id='empty' class='table table-condensed table-bordered'>
          <tbody>
            <th> Scenarios</th>

            <% empty.each do |scen| %>
              <tr>
                <td><%= scen.name %></td>
              </tr>
            <% end %>
          </tbody>
        </table>
        <p class="more"><a href="#">Show more</a></p>

        <h2>
          <a name='grouping'> Step grouping</a>
        </h2>
        <table id='grouping' class='table table-condensed table-bordered'>
          <tbody>
            <th> Step</th>
            <th> Total step associations</th>

            <% groupings.each_with_index do |grouping, i|
               next if grouping.use_count == 0 %>
              <tr class='grouping_row'>
                <td>
                  <%= grouping.regex.inspect %>
                  <br />
                  <a href='#' class="g<%=i %>">Associated steps</a>
                  <br />
                  <div class="assoc_steps g<%=i %>" style='display:none;'>
                    <table class='table table-condensed table-bordered'>
                      <tbody>
                      <tr>
                        <th> Association count</th>
                        <th> Step</th>
                      </tr>
                        <% grouping.step_collection.each do |step| %>
                          <tr>
                            <td><%= step.count %></td>
                            <td><%= CGI.escapeHTML(step.to_s) %></td>
                          </tr>
                        <% end %>
                      </tbody>
                    </table>
                  </div>
                </td>
                <td><%= grouping.use_count %></td>
              </tr>
            <% end %>
          </tbody>
        </table>
        <p class="more"><a href="#">Show more</a></p>
    <script src='stepdown.js'></script>
  </body>
</html>

